package com.zzzy.doc.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.zzzy.doc.dto.DataRegionDto;
import com.zzzy.doc.dto.DataTagDto;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;

import java.util.List;

/**
 * 公文文件信息
 *
 * @author fc
 * @since 2024-08-12
 */
@Getter
@Setter
@TableName(value = "doc_file", autoResultMap = true)
@Schema(description = "公文文件信息")
public class DocFile {

    @Schema(description = "ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @Schema(description = "合同ID")
    @TableField("doc_id")
    private Long docId;

    @Schema(description = "文件模板名称")
    @TableField("template_name")
    private String templateName;

    @Schema(description = "呈批表二进制流")
    @TableField("approval_file_blob")
    private byte[] approvalFileBlob;

    @Schema(description = "呈批表全部可编辑区域")
    @TableField(value = "approval_data_regions", typeHandler = JacksonTypeHandler.class)
    private List<DataRegionDto> approvalDataRegions;

    @Schema(description = "正文二进制流")
    @TableField("main_file_blob")
    private byte[] mainFileBlob;

    @Schema(description = "正文预置数据标签")
    @TableField(value = "main_init_data_tags", typeHandler = JacksonTypeHandler.class)
    private List<DataTagDto> mainInitDataTags;

    @Schema(description = "套红文件二进制流")
    @TableField("red_sheet_file_blob")
    private byte[] redSheetFileBlob;

    @Schema(description = "正文中的修订痕迹数量")
    @TableField("main_revision_count")
    private Integer mainRevisionCount;

    @Schema(description = "PDF文件二进制流（长度最大为25MB）")
    @TableField("pdf_file_blob")
    private byte[] pdfFileBlob;

    @Schema(description = "会签盖章时间")
    @TableField("add_joint_sign_time")
    private String addJointSignTime;

    @Schema(description = "签发盖章时间")
    @TableField("add_leader_sign_time")
    private String addLeaderSignTime;
}
